/**
 * 封禁的相关api
 */
angular.module('imsApp').factory('DisallowManager', ['$http', 'api','paramsManager', function ($http,api, paramsManager) {
    var DisallowManager = {
        /**
         * 获取设备的Id的列表
         params:[pageNo,pageSize]//顺序不能错
         query{}
         */
        cuidList: function (params, query) {
            return $http.get(api+"/ims/disallowCuids/" + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 获取关注的ip的列表
         params:[pageNo,pageSize]//顺序不能错
         query{}
         */
        ipList: function (params, query) {
            return $http.get(api+"/ims/disallowIps/" + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 添加设备到封禁列表
         */
        cuidAdd: function (params) {
            return $http.post(api+"/ims/disallowCuids", params).then(function (result) {
                return result;
            });
        },
        /**
         * 添加ip到
         */
        ipAdd: function (params) {
            return $http.post(api+"/ims/disallowIps", params).then(function (result) {
                return result;
            });
        },
        /**
         * 取消封禁的设备id
         */
        cuIdReAllow: function (ids) {
            return $http.delete(api+"/ims/disallowCuids/" + ids.join(",")).then(function (result) {
                return result;
            });
        },
        /**
         * 取消关注的Ip
         */
        ipReAllow: function (ids) {
            return $http.delete(api+"/ims/disallowIps/" + ids.join(",")).then(function (result) {
                return result;
            });
        }


    }


    return DisallowManager;
}]);
